package isp.apps.example.shoppingcart.domain;

import java.math.BigDecimal;

import java.text.DateFormat;

import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.HashSet;
import java.util.Set;

public class Item
{
  private Calendar calendar;
  private Integer id;
  private String sku;
  private String name;
  private String description;
  private BigDecimal cost;
  private Integer valid, inventory;
  private Calendar invalidDate;
  private Set cartItems = new HashSet();

  public void setSku(String sku)
  {
    this.sku = sku;
  }

  public void setDescription(String description)
  {
    this.description = description;
  }

  public void setCost(BigDecimal cost)
  {
    this.cost = cost;
  }

  public void setName(String name)
  {
    this.name = name;
  }

  public String getSku()
  {
    return sku;
  }

  public String getName()
  {
    return name;
  }

  public BigDecimal getCost()
  {
    return cost;
  }

  public String getDescription()
  {
    return description;
  }

  public void setId(Integer id)
  {
    this.id = id;
  }

  public Integer getId()
  {
    return id;
  }

  public void setValid(Integer valid)
  {
    this.valid = valid;
  }

  public Integer getValid()
  {
    return valid;
  }

  public void setInventory(Integer inventory)
  {
    this.inventory = inventory;
  }

  /**
   * @return inventory an Integer of the inventory count
   */
  public Integer getInventory()
  {
    return inventory;
  }


  public String getInvalidTimeStamp()
  {
    return DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM).format(invalidDate.getTime());
  }


  public void setInvalidDate(Calendar invalidDate)
  {
    this.invalidDate = invalidDate;
  }

  public Calendar getInvalidDate()
  {
    return invalidDate;
  }

  public Set getCartItems()
  {
    return cartItems;
  }

  public void setCartItems(Set cartItems)
  {
    this.cartItems = cartItems;
  }
}
